import jquery from 'jquery'

const $: JQueryStatic = jquery

const articleParent = $('.admin-content-body')
function check(): void {
    if (window.location.href !== 'https://www.luogu.com.cn/webadmin/blog/review') return
    let reviewCount = articleParent.find('article').length
    $('.solution-accept, .solution-reject').on('click', function(): void {
        if (--reviewCount < 1) {
            setTimeout(function() {
                window.location.reload()
            }, 1000)
        }
    })
}
export { check }
